$(function() {
//	$('#main').css({
//		'height': $('.layout-panel-center>.layout-body').height() - $('#menu').height()
//	});
//	$('#main>div').css({
//		'padding-top': $('#main').height() * 0.4
//	});
	$('.layout-panel-west .nav > li > a').click(function() {
		$('.layout-panel-west .nav > li.active').removeClass('active');
		$(this).parent().addClass('active');
		var url = $(this).attr('rel');
		makeFrame(url);
		var menu = $('#menu>.breadcrumb');
		var mtxt = '<li><a href="index.html">首页</a></li>';
		mtxt += '<li id="mli0">' + '<a onclick="lastTabs(0)" href="javascript:void(0);" rel="' + url + '">' + $(this).children('.pp').html() + '</a></li>';
		menu.html(mtxt);
		return false;
	});
})

function logout() {
	$.messager.confirm('退出提示', '你确定要退出当前系统吗?', function(r) {
		if (r) {
			location.href = 'login.html';
		}
	});
}


function lastTabs(e) {
	$('#mli' + e).nextAll().remove();
	var url = $('#mli' + e + '>a').attr('rel');
	makeFrame(url);
	return false;
}

function openTabs(url, title, e) {
	var mtxt = '<li id="mli' + e + '"><a onclick="lastTabs(' + e + ')" href="javascript:void(0);" rel="' + url + '">' + title + '</a></li>';
	$('.breadcrumb', parent.document).append(mtxt);
	makeFrame(url);
	return false;
}

function removeTabs() {
	$('.breadcrumb li:last-child', parent.document).remove();
	var url = $('.breadcrumb li:last-child>a', parent.document).attr('rel');
	makeFrame(url);
	return false;
}

function makeFrame(url) {
	var iframe = '<iframe frameborder="0" src="' + url + '">您的浏览器不支持嵌入式框架，或者当前配置为不显示嵌入式框架。</iframe>';
	$('#main', parent.document).html(iframe);
}